package com.ruoyi.womp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.womp.mapper.WompWorkOrderMapper;
import com.ruoyi.womp.domain.WompWorkOrder;
import com.ruoyi.womp.service.IWompWorkOrderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 工单列表Service业务层处理
 * 
 * @author mzz
 * @date 2022-04-11
 */
@Service
public class WompWorkOrderServiceImpl implements IWompWorkOrderService 
{
    @Autowired
    private WompWorkOrderMapper wompWorkOrderMapper;

    /**
     * 查询工单列表
     * 
     * @param id 工单列表主键
     * @return 工单列表
     */
    @Override
    public WompWorkOrder selectWompWorkOrderById(Integer id)
    {
        return wompWorkOrderMapper.selectWompWorkOrderById(id);
    }

    /**
     * 查询工单列表列表
     * 
     * @param wompWorkOrder 工单列表
     * @return 工单列表
     */
    @Override
    public List<WompWorkOrder> selectWompWorkOrderList(WompWorkOrder wompWorkOrder)
    {
        return wompWorkOrderMapper.selectWompWorkOrderList(wompWorkOrder);
    }

    /**
     * 新增工单列表
     * 
     * @param wompWorkOrder 工单列表
     * @return 结果
     */
    @Override
    public int insertWompWorkOrder(WompWorkOrder wompWorkOrder)
    {
        wompWorkOrder.setCreateTime(DateUtils.getNowDate());
        return wompWorkOrderMapper.insertWompWorkOrder(wompWorkOrder);
    }

    /**
     * 修改工单列表
     * 
     * @param wompWorkOrder 工单列表
     * @return 结果
     */
    @Override
    public int updateWompWorkOrder(WompWorkOrder wompWorkOrder)
    {
        wompWorkOrder.setUpdateTime(DateUtils.getNowDate());
        return wompWorkOrderMapper.updateWompWorkOrder(wompWorkOrder);
    }

    /**
     * 批量删除工单列表
     * 
     * @param ids 需要删除的工单列表主键
     * @return 结果
     */
    @Override
    public int deleteWompWorkOrderByIds(String ids)
    {
        return wompWorkOrderMapper.deleteWompWorkOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工单列表信息
     * 
     * @param id 工单列表主键
     * @return 结果
     */
    @Override
    public int deleteWompWorkOrderById(Integer id)
    {
        return wompWorkOrderMapper.deleteWompWorkOrderById(id);
    }
}
